﻿using System;
using System.Collections.Generic;
using System.Text;
using BlueLotus7.MetaWeblogUtil.Contract;
using BlueLotus7.MetaWeblogUtil.Contract.Interfaces;
using CookComputing.XmlRpc;

namespace BlueLotus7.MetaWeblogUtil.CnBlogs.Contract.Interfaces
{
    [XmlRpcUrl("http://www.cnblogs.com/services/metaweblog.aspx")]
    public interface ICnBlogsMetaWeblogProxy : IXmlRpcProxy
    {
        [XmlRpcMethod(XmlRpcMethodList.metaWeblog_newPost)]
        string NewPost(string blogid, string username, string password, CnBlogsPost post, bool publish);

        [XmlRpcMethod(XmlRpcMethodList.metaWeblog_editPost)]
        bool EditPost(string postid, string username, string password, CnBlogsPost post, bool publish);

        [XmlRpcMethod(XmlRpcMethodList.metaWeblog_getPost)]
        CnBlogsPost GetPost(string postid, string username, string password);

        [XmlRpcMethod(XmlRpcMethodList.metaWeblog_newMediaObject)]
        UrlData NewMediaObject(string blogid, string username, string password, FileData file);

        [XmlRpcMethod(XmlRpcMethodList.blogger_deletePost)]
        [return: XmlRpcReturnValue(Description = "Returns true.")]
        bool DeletePost(string appKey, string postid, string username, string password, bool publish);

        [XmlRpcMethod(XmlRpcMethodList.blogger_getUsersBlogs)]
        BlogInfo[] GetUserBlogs(string appkey, string username, string password);

        [XmlRpcMethod(XmlRpcMethodList.metaWeblog_getRecentPosts)]
        CnBlogsPost[] GetRecentPosts(string blogid, string username, string password, int numberOfPosts);

        [XmlRpcMethod(XmlRpcMethodList.metaWeblog_getCategories)]
        CategoryInfo[] GetCategories(string blogid, string username, string password);
    }
}
